class Student:

    def __init__(self, sid, name, age, gender, height, weight, grade, address, phone):
        self.phone = phone
        self.address = address
        self.grade = grade
        self.weight = weight
        self.height = height
        self.gender = gender
        self.age = age
        self.name = name
        self.sid = sid

    def study(self, time):
        print(f"{self.name} 学习了 {time} 分钟！")

    def play_game(self, game):
        print(f"{self.name} 正在玩 {game} ！")

    def coding(self, line):
        print(f"{self.name} 编写了 {line} 行代码！")

    @staticmethod
    def sum(*args):
        res = 0
        for num in args:
            res += num
        return res


class Car:
    def __init__(self, version, wheel, color, weight, fuel_tank):
        self.fuel_tank = fuel_tank
        self.weight = weight
        self.color = color
        self.wheel = wheel
        self.version = version

    def run(self, feature):
        print(f"{self.version} 可以跑 {feature}")


ferrari = Car("法拉利599", 4, "红色", 1690, 105)
bmw = Car("宝马3系 2024款 325Li M 运动套装", 4, "炭黑", 1610, 59)
suzuki = Car("铃木骁途", 4, "晶岩灰", 1210, 47)
wuling = Car("五菱星光 2024 款共创版 PHEV 150 标准版", 4, "星耀白", 1500, 35)
tractor = Car("东方红 LX1600", 4, "红色", 5000, 220)

ferrari.run("赛车")
bmw.run("越野")
tractor.run("拉货")

'''
笔记本：属性：型号，待机时间，颜色，重量，cpu型号，内存大小，硬盘大小。  行为：打游戏（传入游戏的名称）,办公。
'''


class NoteBook:
    def __init__(self, version, standby_time, color, weight, cpu_type, memory, disk):
        self.disk = disk
        self.memory = memory
        self.cpu_type = cpu_type
        self.weight = weight
        self.color = color
        self.standby_time = standby_time
        self.version = version

    def play_game(self, game):
        print(f"正在使用 {self.version} 打 {game}。")

    def office(self):
        print(f"正在使用 {self.version} 办公。")


x14 = NoteBook("暴风雪x14", 7, "白色", 1.45, "AMD 8845HS", 32, 1024)
x14.play_game("英雄联盟")
x14.office()


class Monkey:
    def __init__(self, category, gender, color, weight):
        self.weight = weight
        self.color = color
        self.gender = gender
        self.category = category

    def make_fire(self, source):
        print(f"{self.category} 会使用 {source} 造火。")

    def study(self, *args):
        args_str = ', '.join(map(str, args))
        print(f"{self.category} 学习了 {args_str}。")


sapiens = Monkey("智人", "男", "黄", 120)
sapiens.make_fire("木棍")
sapiens.study("游泳", "爬山", "射箭")


class Humans:
    def __init__(self, name, gender, age, phone_bill, phone_brand, phone_battery, phone_screen, phone_standby_time,
                 score):
        self.phone_brand = phone_brand
        self.gender = gender
        self.score = score
        self.phone_standby_time = phone_standby_time
        self.phone_screen = phone_screen
        self.phone_battery = phone_battery
        self.phone_bill = phone_bill
        self.age = age
        self.name = name

    def __str__(self):
        return f"{self.name} 的话费余额为 {self.phone_bill} 元，积分为 {self.score}。"

    def send_message(self, message):
        print(f"{self.name} 正在使用手机发送 {message}。")

    def call(self, phone_number, time):
        if not phone_number:
            print("手机号为空！")
            return
        if self.phone_bill < 1.0:
            print("花费余额不足！")
            return

        if 0 <= time <= 10:
            spend = time * 1.0
            score = time * 15
        elif 10 < time <= 20:
            spend = 10 * 1.0 + (time - 10) * 0.8
            score = 10 * 15 + (time - 10) * 39
        elif time > 20:
            spend = 10 * 1.0 + 10 * 0.8 + (time - 20) * 0.65
            score = 10 * 15 + 10 * 39 + (time - 20) * 48
        else:
            print("非法时间！")
            return

        self.phone_bill -= spend
        self.score += score


h1 = Humans("张三", "男", 18, 100, "华为 P40 Pro", 5000, 6.5, 30, 100)
h1.call("18140636389", 25)
print(h1)
